if(showBtn){
    var btn = $('<button>Click me</button>');
    btn.on('click',function(){
        console.log('Clicked');
    });
    $('#app').append(btn);
}